#include <bits/stdc++.h>
using namespace std;

int main(){
	int flag1=0,flag2=0,dayCount=0,twoDay=0,mile = 0;
	for(int year=2000;year<=2020;year++){
		for(int month=1;month<=12;month++)
			for(int day=1;day<=31;day++)
			{
				if(month==1||month==3||month==5||month==7||month==8
					||month==10||month==12){
				}else if(month==2){
					if((year%4==0&&year%100!=0)||year %400==0)
					{
						if(day>29) break;
					}else{
						if(day>28) break;
					}
				}else{
					if(day>30)break;
				}
				if(year==2000&&month==1&&day==1) flag1=1;
				if(flag1==1){
				 	dayCount++;
					if(day==1||(dayCount%7+5)%7==1){
						twoDay++;
					}
				}				
				if(year==2020&&month==10&&day==1) flag1=0;
			}
	}
	mile=dayCount+twoDay;
	cout<<mile;
	return 0;
}
